package com.aabte.design2.behavioral.observer;

/**
 * @author Daniel
 * @version 1.0
 * @date 2020/5/4
 */
public class Application {

    public static void main(String[] args) {
        EventManager eventManager = new EventManager();
        eventManager.subscribe("open", new LoggingEventListener());
        eventManager.subscribe("save", new EmailAlertEventListener());

        Editor editor = new Editor();
        editor.setEventManager(eventManager);

        editor.openFile("abc.txt");
        editor.saveFile();
    }

}
